package com.hmdp.config;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 作者：24岁没牵过女人的手
 * 日期：2023/3/12 15:37
 * 文件描述：
 */
@Configuration
public class RedisConfig {

    @Bean
    public RedissonClient redissonClient(){
        // 配置config
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379"); //.setPassword("2410");
        return Redisson.create(config);
    }

    @Bean
    public RedissonClient redissonClient2(){
        // 配置config
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6380").setPassword("2410");
        return Redisson.create(config);
    }

    @Bean
    public RedissonClient redissonClient3(){
        // 配置config
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6381").setPassword("2410");
        return Redisson.create(config);
    }
}
